﻿{% extends "base.html" %}
{% block content %}
    <div id="main-container" class="container clearfix">
        <section class="post-left">
            <div class="breadcrumb">您的位置： <a itemprop="breadcrumb" href="/">首页</a> » <span
                    class="current">{{ tname }}</span></div>
            <div class="index-main clearfix">
                <div class="main-title">
                    <h4 class="post-left-title">标签：{{ tname }}</h4>
                </div>
                <div class="row">
                    {% for article in list %}
                        <div class="article-box clearfix excerpt-1">
                            <div class="col-md-4">
                                <div class="thumbnail">
                                    <a href="/show-{{ article.id }}.html" title="{{ article.title }}">
                                        {% if article.img %}
                                            <img src="/media/{{ article.img }}"
                                                 srcset="/media/{{ article.img }}"
                                                 alt="{{ article.title }}" class="wp-post-image" width="240"
                                                 height="160"/></a>
                                        {% else %}
                                            <img src="https://t1.hddhhn.com/uploads/tu/201903/17/1.jpg"
                                                 srcset="https://t1.hddhhn.com/uploads/tu/201903/17/1.jpg"
                                                 alt="{{ article.title }}" class="wp-post-image" width="240"
                                                 height="160"/></a>
                                        {% endif %}
                                </div>
                            </div>
                            <div class="col-md-8">
                                <h2><a href="/show-{{ article.id }}.html" target="_blank"
                                       title="{{ article.title }}">{{ article.title }}</a></h2>
                                <p class="txtcont hidden-xs"><a href="/show-{{ article.id }}.html"
                                                                target="_blank"
                                                                title="{{ article.title }}">{{ article.excerpt }}</a>
                                </p>
                                <div class="meta"><span class="label label-info"><a
                                        href="/list-{{ article.category.id }}.html">{{ article.category.name }}</a></span>
                                    <time class="item"><i
                                            class="fa fa-clock-o"></i>{{ article.created_time|date:'Y年m月d日' }}
                                    </time>
                                </div>
                            </div>
                        </div>
                    {% endfor %}

                    <div class="pagination">
                        <ul>
                            {% if  list.has_previous %}
                                <li class="prev-page">
                                    <a href="?page={{ list.previous_page_number }}">
                                        上一页
                                    </a>
                                </li>
                            {% else %}
                                <li class="prev-page"></li>
                            {% endif %}
                            {% for num in list.paginator.page_range %}

                                {% if num %}
                                    {% ifequal num list.number %}
                                        <li class="active"><span>{{ num }}</span></li>
                                    {% else %}
                                        <li class="active">
                                            <a href="?page={{ num }}">{{ num }}</a>
                                        </li>
                                    {% endifequal %}
                                {% else %}
                                    <li class="disabled"><span>...</span></li>
                                {% endif %}

                            {% endfor %}
                            {% if  list.has_next %}
                                <li class="next-page"><a href="?page={{ list.next_page_number }}">下一页</a></li>
                            {% else %}
                                <li class="prev-page"></li>
                            {% endif %}
                        </ul>
                    </div>
                </div>
            </div>

            <!-- /文章列表 -->
        </section>
        <!-- /post-left -->
        <!-- /post-right -->
        <aside class="post-right hidden-xs">
            </section></section>

            {% include 'right.html' %}

        </aside>
    </div>
{% endblock %}